---
id: 5ef9b03c81a63668521804d7
title: Hatua ya 36
challengeType: 0
dashedName: step-36
---

# --description--

The `action` attribute indicates where form data should be sent.

Here is an example of a `form` element with an `action` attribute:

```html
<form action="/submit-url"></form>
```

In the example, `action="/submit-url"` tells the browser that the form data should be sent to the path `/submit-url`.

Ongeza sifa ya `action` yenye thamani `https://freecatphotoapp.com/submit-cat-photo` kwenye kipengele cha `form`.

# --hints--

Kipengele chako cha `form` kinapaswa kuwa na tagi ya ufunguzi na tagi ya kufunga kwa mpangilio sahihi. Huenda unakosa tagi moja au zote mbili zinazohitajika, au kuwa nazo katika mpangilio usio sahihi.

```js
const noSpaces = code.replace(/\s/g, '');
assert(
  document.querySelector('form') &&
    code.match(/<\/form>/g) &&
    noSpaces.indexOf('<form') < noSpaces.indexOf('</form>')
);
```

Kipengele chako cha `form` kilichowekwa katika `section` ya mwisho lazima kiwe chini ya kipengele cha `h2`. Una kipengele cha `h2` na kipengele cha `form` katika mpangilio usio sahihi.

```js
assert(document.querySelector('form').previousElementSibling.nodeName === 'H2');
```

Kipengele cha `form` hakipaswi kuwa na maudhui. Ondoa vipengele au maandishi yoyote ya HTML kati ya tagi za kipengele cha `form`.

```js
assert($('form')[0].innerHTML.trim().length === 0);
```

Kipengele chako cha `form` hakina sifa ya `action`. Hakikisha kuwa kuna nafasi baada ya jina la tagi inayofungua na/au kuna nafasi kabla ya majina yote ya sifa.

```js
const form = document.querySelector('form');
assert(form.hasAttribute('action'));
```

Kipengele chako cha `form` kinafaa kuwa na sifa ya `action` yenye thamani `https://freecatphotoapp.com/submit-cat-photo`.

```js
const form = document.querySelector('form');
assert(
  form
    .getAttribute('action')
    .match(/^https:\/\/freecatphotoapp\.com\/submit-cat-photo$/)
);
```

Ingawa umeweka sifa ya `action` kwa URL sahihi, inashauriwa kuzunguka thamani ya sifa kila wakati kwa alama za nukuu.

```js
assert(
  !/\<form\s+action\s*=\s*https:\/\/freecatphotoapp\.com\/submit-cat-photo/.test(
    code
  )
);
```

# --seed--

## --seed-contents--

```html
<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>cat nip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
      <section>
        <h2>Cat Form</h2>
--fcc-editable-region--
        <form>
        </form>
--fcc-editable-region--
      </section>
    </main>
  </body>
</html>
```

